package icu.guodapeng.work.controller

import icu.guodapeng.api.service.EchoService
import org.apache.dubbo.config.annotation.Reference
import org.springframework.core.env.Environment
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RestController
import javax.annotation.Resource

@RestController
class EchoController {
    @Resource
    private lateinit var env: Environment

    @Reference
    lateinit var echoService: EchoService

    @GetMapping("/echo/{param}")
    fun echo(@PathVariable param: String): String {
        return echoService.echo(param) + ". mark: ${env.getProperty("mark")}"
    }
}
